<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>担保交友列表 - 高级筛选</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #f0f9ff;
            --secondary: #64748b;
            --light: #f8fafc;
            --dark: #1e293b;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #e2e8f0;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: #f5f7ff;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            box-shadow: var(--shadow);
            background-color: white;
        }
        
        .container {
            padding: 2rem 0;
        }
        
        .section-header {
            margin-bottom: 2rem;
        }
        
        .section-title {
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: var(--dark);
            position: relative;
            display: inline-block;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 50px;
            height: 3px;
            background-color: var(--primary);
            border-radius: 3px;
        }
        
        .section-description {
            color: var(--secondary);
            max-width: 800px;
        }
        
        /* 筛选区域样式 */
        .filter-container {
            background-color: white;
            border-radius: 0.75rem;
            box-shadow: var(--shadow);
            margin-bottom: 2rem;
            overflow: hidden;
        }
        
        .filter-header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .filter-title {
            font-weight: 600;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .filter-toggle {
            background: none;
            border: none;
            color: var(--primary);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            cursor: pointer;
        }
        
        .filter-content {
            padding: 1.5rem;
        }
        
        .filter-row {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        .filter-group {
            flex: 1;
            min-width: 200px;
        }
        
        .filter-label {
            display: block;
            margin-bottom: 0.75rem;
            font-weight: 500;
            color: var(--dark);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 0.5rem;
        }
        
        .filter-chip {
            background-color: var(--light);
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 0.35rem 1rem;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .filter-chip:hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        
        .filter-chip.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .form-select, .form-control {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border-radius: 0.5rem;
            border: 1px solid var(--border);
            font-size: 0.9rem;
        }
        
        .range-slider {
            width: 100%;
            margin: 1rem 0;
        }
        
        .range-labels {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            color: var(--secondary);
        }
        
        .filter-actions {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
            margin-top: 1rem;
        }
        
        .btn {
            padding: 0.5rem 1.25rem;
            border-radius: 0.5rem;
            font-weight: 500;
            transition: all 0.2s;
        }
        
        .btn-primary {
            background-color: var(--primary);
            border-color: var(--primary);
        }
        
        .btn-primary:hover {
            background-color: #4338ca;
            border-color: #4338ca;
        }
        
        .btn-outline-primary {
            color: var(--primary);
            border-color: var(--primary);
        }
        
        .btn-outline-primary:hover {
            background-color: var(--primary);
            color: white;
        }
        
        /* 结果统计 */
        .results-stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .stats-text {
            color: var(--secondary);
            font-size: 0.9rem;
        }
        
        .stats-count {
            font-weight: 600;
            color: var(--primary);
        }
        
        /* 卡片布局 */
        .card {
            border: none;
            border-radius: 0.75rem;
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            background-color: white;
            margin-bottom: 1.5rem;
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        
        .guarantee-badge {
            position: absolute;
            top: 1rem;
            left: 1rem;
            background-color: var(--primary);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 999px;
            font-size: 0.85rem;
            font-weight: 500;
            z-index: 10;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .card-img-container {
            position: relative;
            height: 200px;
            overflow: hidden;
        }
        
        .card-img-top {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }
        
        .card:hover .card-img-top {
            transform: scale(1.05);
        }
        
        .card-body {
            padding: 1.25rem;
        }
        
        .user-info {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .user-details {
            flex: 1;
        }
        
        .user-name {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 0;
        }
        
        .user-meta {
            font-size: 0.8rem;
            color: var(--secondary);
        }
        
        .card-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
            transition: color 0.2s;
        }
        
        .card:hover .card-title {
            color: var(--primary);
        }
        
        .card-text {
            color: var(--secondary);
            font-size: 0.9rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 1rem;
        }
        
        .tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        
        .tag {
            padding: 0.25rem 0.75rem;
            border-radius: 999px;
            font-size: 0.75rem;
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        .card-metrics {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.85rem;
            color: var(--secondary);
            padding-top: 0.75rem;
            border-top: 1px solid var(--border);
        }
        
        .metric {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .card-actions {
            display: flex;
            gap: 1rem;
        }
        
        .action-btn {
            background: none;
            border: none;
            color: var(--secondary);
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.85rem;
            cursor: pointer;
            transition: color 0.2s;
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
        }
        
        .action-btn:hover {
            color: var(--primary);
            background-color: var(--primary-light);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .filter-row {
                flex-direction: column;
                gap: 1rem;
            }
            
            .filter-actions {
                flex-direction: column;
            }
            
            .results-stats {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light">
        <div class="container">
            <a class="navbar-brand" href="#">
                <i class="fas fa-shield-alt text-primary me-2"></i>安全社交
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="#">担保交友</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">活动推荐</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">安全指南</a>
                    </li>
                </ul>
                <div class="d-flex align-items-center gap-3">
                    <button class="btn btn-outline-primary">登录</button>
                    <button class="btn btn-primary">注册</button>
                </div>
            </div>
        </div>
    </nav>
    
    <!-- 主要内容区 -->
    <div class="container">
        <!-- 页面标题 -->
        <div class="section-header">
            <h1 class="section-title">担保交友列表</h1>
            <p class="section-description">通过多种筛选条件，找到最适合您的交友对象。所有用户均经过实名认证和背景审核。</p>
        </div>
        
        <!-- 高级筛选区域 -->
        <div class="filter-container">
            <div class="filter-header">
                <h3 class="filter-title">
                    <i class="fas fa-filter text-primary"></i> 高级筛选
                </h3>
                <button class="filter-toggle" id="filterToggle">
                    <i class="fas fa-chevron-up"></i> 收起筛选
                </button>
            </div>
            
            <div class="filter-content" id="filterContent">
                <!-- 第一行筛选条件 -->
                <div class="filter-row">
                    <div class="filter-group">
                        <label class="filter-label">性别</label>
                        <div class="filter-options">
                            <div class="filter-chip active" data-filter="gender" data-value="all">全部</div>
                            <div class="filter-chip" data-filter="gender" data-value="male">男</div>
                            <div class="filter-chip" data-filter="gender" data-value="female">女</div>
                            <div class="filter-chip" data-filter="gender" data-value="other">其他</div>
                        </div>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">年龄段</label>
                        <div class="filter-options">
                            <div class="filter-chip active" data-filter="age" data-value="all">全部</div>
                            <div class="filter-chip" data-filter="age" data-value="18-25">18-25岁</div>
                            <div class="filter-chip" data-filter="age" data-value="26-35">26-35岁</div>
                            <div class="filter-chip" data-filter="age" data-value="36-45">36-45岁</div>
                            <div class="filter-chip" data-filter="age" data-value="46-55">46-55岁</div>
                            <div class="filter-chip" data-filter="age" data-value="55+">55岁以上</div>
                        </div>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">所在地</label>
                        <select class="form-select" id="locationFilter">
                            <option value="all">全部城市</option>
                            <option value="beijing">北京</option>
                            <option value="shanghai">上海</option>
                            <option value="guangzhou">广州</option>
                            <option value="shenzhen">深圳</option>
                            <option value="hangzhou">杭州</option>
                            <option value="chengdu">成都</option>
                            <option value="wuhan">武汉</option>
                            <option value="chongqing">重庆</option>
                        </select>
                    </div>
                </div>
                
                <!-- 第二行筛选条件 -->
                <div class="filter-row">
                    <div class="filter-group">
                        <label class="filter-label">兴趣爱好</label>
                        <div class="filter-options">
                            <div class="filter-chip" data-filter="hobby" data-value="music">音乐</div>
                            <div class="filter-chip" data-filter="hobby" data-value="sports">运动</div>
                            <div class="filter-chip" data-filter="hobby" data-value="reading">阅读</div>
                            <div class="filter-chip" data-filter="hobby" data-value="travel">旅行</div>
                            <div class="filter-chip" data-filter="hobby" data-value="food">美食</div>
                            <div class="filter-chip" data-filter="hobby" data-value="movie">电影</div>
                            <div class="filter-chip" data-filter="hobby" data-value="game">游戏</div>
                            <div class="filter-chip" data-filter="hobby" data-value="art">艺术</div>
                        </div>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">职业类型</label>
                        <select class="form-select" id="occupationFilter">
                            <option value="all">全部职业</option>
                            <option value="it">IT/互联网</option>
                            <option value="education">教育/培训</option>
                            <option value="finance">金融/银行</option>
                            <option value="medical">医疗/健康</option>
                            <option value="art">艺术/设计</option>
                            <option value="business">商业/管理</option>
                            <option value="service">服务行业</option>
                            <option value="student">学生</option>
                        </select>
                    </div>
                </div>
                
                <!-- 第三行筛选条件 -->
                <div class="filter-row">
                    <div class="filter-group">
                        <label class="filter-label">交友目的</label>
                        <div class="filter-options">
                            <div class="filter-chip active" data-filter="purpose" data-value="all">全部</div>
                            <div class="filter-chip" data-filter="purpose" data-value="friend">普通朋友</div>
                            <div class="filter-chip" data-filter="purpose" data-value="hobby">兴趣伙伴</div>
                            <div class="filter-chip" data-filter="purpose" data-value="study">学习交流</div>
                            <div class="filter-chip" data-filter="purpose" data-value="travel">旅行同伴</div>
                            <div class="filter-chip" data-filter="purpose" data-value="dating">恋爱约会</div>
                        </div>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">在线状态</label>
                        <div class="filter-options">
                            <div class="filter-chip active" data-filter="online" data-value="all">全部</div>
                            <div class="filter-chip" data-filter="online" data-value="online">在线</div>
                            <div class="filter-chip" data-filter="online" data-value="recent">最近活跃</div>
                        </div>
                    </div>
                </div>
                
                <!-- 第四行筛选条件：距离范围 -->
                <div class="filter-row">
                    <div class="filter-group">
                        <label class="filter-label">距离范围 (公里)</label>
                        <input type="range" min="1" max="100" value="50" class="range-slider" id="distanceRange">
                        <div class="range-labels">
                            <span>1公里</span>
                            <span id="rangeValue">50公里</span>
                            <span>100公里</span>
                        </div>
                    </div>
                    
                    <div class="filter-group">
                        <label class="filter-label">排序方式</label>
                        <select class="form-select" id="sortFilter">
                            <option value="recommended">推荐优先</option>
                            <option value="distance">距离最近</option>
                            <option value="newest">最新加入</option>
                            <option value="popular">人气最高</option>
                            <option value="online">在线优先</option>
                        </select>
                    </div>
                </div>
                
                <!-- 搜索框 -->
                <div class="filter-row">
                    <div class="filter-group" style="min-width: 100%;">
                        <label class="filter-label">关键词搜索</label>
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="输入昵称、兴趣或简介关键词搜索...">
                            <button class="btn btn-primary" type="button">
                                <i class="fas fa-search"></i> 搜索
                            </button>
                        </div>
                    </div>
                </div>
                
                <!-- 筛选操作按钮 -->
                <div class="filter-actions">
                    <button class="btn btn-outline-primary" id="resetFilters">
                        <i class="fas fa-sync-alt"></i> 重置筛选
                    </button>
                    <button class="btn btn-primary" id="applyFilters">
                        <i class="fas fa-check"></i> 应用筛选
                    </button>
                </div>
            </div>
        </div>
        
        <!-- 结果统计和列表视图切换 -->
        <div class="results-stats">
            <div class="stats-text">找到 <span class="stats-count">24</span> 位符合条件的用户</div>
            <div class="layout-switcher d-flex gap-2">
                <button class="btn btn-sm btn-outline-primary active" title="卡片视图">
                    <i class="fas fa-th"></i>
                </button>
                <button class="btn btn-sm btn-outline-primary" title="列表视图">
                    <i class="fas fa-list"></i>
                </button>
            </div>
        </div>
        
        <!-- 交友列表 -->
        <div class="row">
            <!-- 用户卡片 1 -->
            <div class="col-lg-3 col-md-4 col-sm-6">
                <div class="card">
                    <div class="card-img-container">
                        <div class="guarantee-badge">
                            <i class="fas fa-check"></i> 已认证
                        </div>
                        <img src="https://picsum.photos/600/400?random=1" alt="陈明亮的个人照片" class="card-img-top">
                    </div>
                    <div class="card-body">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=101" alt="陈明亮的头像" class="user-avatar">
                            <div class="user-details">
                                <h5 class="user-name">陈明亮</h5>
                                <div class="user-meta">28岁 · 上海 · 设计师</div>
                            </div>
                        </div>
                        
                        <h5 class="card-title">寻找摄影爱好者</h5>
                        <p class="card-text">喜欢街拍和风光摄影，希望能找到一起外拍、交流技巧的朋友。</p>
                        
                        <div class="tags">
                            <span class="tag">摄影</span>
                            <span class="tag">旅行</span>
                            <span class="tag">艺术</span>
                        </div>
                        
                        <div class="card-metrics">
                            <div>
                                <span class="metric me-3"><i class="fas fa-eye"></i> 1.2k</span>
                                <span class="metric"><i class="fas fa-comment"></i> 32</span>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i> 128
                                </button>
                                <button class="action-btn">
                                    <i class="fas fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 用户卡片 2 -->
            <div class="col-lg-3 col-md-4 col-sm-6">
                <div class="card">
                    <div class="card-img-container">
                        <div class="guarantee-badge">
                            <i class="fas fa-check"></i> 已认证
                        </div>
                        <img src="https://picsum.photos/600/400?random=2" alt="林小雨的个人照片" class="card-img-top">
                    </div>
                    <div class="card-body">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=102" alt="林小雨的头像" class="user-avatar">
                            <div class="user-details">
                                <h5 class="user-name">林小雨</h5>
                                <div class="user-meta">25岁 · 北京 · 程序员</div>
                            </div>
                        </div>
                        
                        <h5 class="card-title">读书讨论爱好者</h5>
                        <p class="card-text">喜欢读科幻和历史类书籍，希望能找到可以一起讨论书中观点的朋友。</p>
                        
                        <div class="tags">
                            <span class="tag">阅读</span>
                            <span class="tag">科幻</span>
                            <span class="tag">历史</span>
                        </div>
                        
                        <div class="card-metrics">
                            <div>
                                <span class="metric me-3"><i class="fas fa-eye"></i> 856</span>
                                <span class="metric"><i class="fas fa-comment"></i> 24</span>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn">
                                    <i class="fas fa-heart"></i> 76
                                </button>
                                <button class="action-btn">
                                    <i class="fas fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 用户卡片 3 -->
            <div class="col-lg-3 col-md-4 col-sm-6">
                <div class="card">
                    <div class="card-img-container">
                        <div class="guarantee-badge">
                            <i class="fas fa-check"></i> 已认证
                        </div>
                        <img src="https://picsum.photos/600/400?random=3" alt="王大山的个人照片" class="card-img-top">
                    </div>
                    <div class="card-body">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=103" alt="王大山的头像" class="user-avatar">
                            <div class="user-details">
                                <h5 class="user-name">王大山</h5>
                                <div class="user-meta">32岁 · 广州 · 户外教练</div>
                            </div>
                        </div>
                        
                        <h5 class="card-title">户外探险伙伴</h5>
                        <p class="card-text">热爱登山、露营和徒步，每月都会组织户外活动，欢迎新手加入。</p>
                        
                        <div class="tags">
                            <span class="tag">户外</span>
                            <span class="tag">登山</span>
                            <span class="tag">露营</span>
                        </div>
                        
                        <div class="card-metrics">
                            <div>
                                <span class="metric me-3"><i class="fas fa-eye"></i> 2.1k</span>
                                <span class="metric"><i class="fas fa-comment"></i> 58</span>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i> 215
                                </button>
                                <button class="action-btn">
                                    <i class="fas fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 用户卡片 4 -->
            <div class="col-lg-3 col-md-4 col-sm-6">
                <div class="card">
                    <div class="card-img-container">
                        <div class="guarantee-badge">
                            <i class="fas fa-check"></i> 已认证
                        </div>
                        <img src="https://picsum.photos/600/400?random=4" alt="张悦的个人照片" class="card-img-top">
                    </div>
                    <div class="card-body">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=104" alt="张悦的头像" class="user-avatar">
                            <div class="user-details">
                                <h5 class="user-name">张悦</h5>
                                <div class="user-meta">29岁 · 成都 · 音乐老师</div>
                            </div>
                        </div>
                        
                        <h5 class="card-title">音乐爱好者</h5>
                        <p class="card-text">专业小提琴演奏者，想组建一个小型室内乐组合，寻找音乐伙伴。</p>
                        
                        <div class="tags">
                            <span class="tag">音乐</span>
                            <span class="tag">小提琴</span>
                            <span class="tag">演出</span>
                        </div>
                        
                        <div class="card-metrics">
                            <div>
                                <span class="metric me-3"><i class="fas fa-eye"></i> 3.5k</span>
                                <span class="metric"><i class="fas fa-comment"></i> 94</span>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i> 326
                                </button>
                                <button class="action-btn">
                                    <i class="fas fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 分页 -->
        <nav class="mt-4" aria-label="Page navigation">
            <ul class="pagination justify-content-center">
                <li class="page-item disabled">
                    <a class="page-link" href="#" tabindex="-1">上一页</a>
                </li>
                <li class="page-item active"><a class="page-link" href="#">1</a></li>
                <li class="page-item"><a class="page-link" href="#">2</a></li>
                <li class="page-item"><a class="page-link" href="#">3</a></li>
                <li class="page-item">
                    <a class="page-link" href="#">下一页</a>
                </li>
            </ul>
        </nav>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 筛选区域展开/收起功能
            const filterToggle = document.getElementById('filterToggle');
            const filterContent = document.getElementById('filterContent');
            let filterExpanded = true;
            
            filterToggle.addEventListener('click', function() {
                filterExpanded = !filterExpanded;
                if (filterExpanded) {
                    filterContent.style.display = 'block';
                    filterToggle.innerHTML = '<i class="fas fa-chevron-up"></i> 收起筛选';
                } else {
                    filterContent.style.display = 'none';
                    filterToggle.innerHTML = '<i class="fas fa-chevron-down"></i> 展开筛选';
                }
            });
            
            // 距离范围滑块
            const distanceRange = document.getElementById('distanceRange');
            const rangeValue = document.getElementById('rangeValue');
            
            distanceRange.addEventListener('input', function() {
                rangeValue.textContent = `${this.value}公里`;
            });
            
            // 筛选芯片选择
            const filterChips = document.querySelectorAll('.filter-chip');
            
            filterChips.forEach(chip => {
                chip.addEventListener('click', function() {
                    const filterType = this.getAttribute('data-filter');
                    
                    // 如果是单选筛选（如性别、年龄），移除同类型其他选项的选中状态
                    if (['gender', 'age', 'purpose', 'online'].includes(filterType)) {
                        document.querySelectorAll(`.filter-chip[data-filter="${filterType}"]`)
                            .forEach(c => c.classList.remove('active'));
                    }
                    
                    // 切换当前选项的选中状态
                    this.classList.toggle('active');
                });
            });
            
            // 应用筛选按钮
            const applyFiltersBtn = document.getElementById('applyFilters');
            
            applyFiltersBtn.addEventListener('click', function() {
                // 收集所有选中的筛选条件
                const selectedFilters = {};
                
                document.querySelectorAll('.filter-chip.active').forEach(chip => {
                    const filterType = chip.getAttribute('data-filter');
                    const filterValue = chip.getAttribute('data-value');
                    
                    if (!selectedFilters[filterType]) {
                        selectedFilters[filterType] = [];
                    }
                    selectedFilters[filterType].push(filterValue);
                });
                
                // 添加其他筛选条件
                selectedFilters.location = document.getElementById('locationFilter').value;
                selectedFilters.occupation = document.getElementById('occupationFilter').value;
                selectedFilters.distance = document.getElementById('distanceRange').value;
                selectedFilters.sort = document.getElementById('sortFilter').value;
                
                // 显示筛选结果（实际应用中这里会发送请求到服务器）
                console.log('应用筛选条件:', selectedFilters);
                
                // 模拟加载效果
                this.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 筛选中...';
                
                setTimeout(() => {
                    this.innerHTML = '<i class="fas fa-check"></i> 应用筛选';
                    // 这里可以更新用户列表
                    alert('已应用筛选条件，共找到24位符合条件的用户');
                }, 1000);
            });
            
            // 重置筛选按钮
            const resetFiltersBtn = document.getElementById('resetFilters');
            
            resetFiltersBtn.addEventListener('click', function() {
                // 重置所有筛选芯片
                document.querySelectorAll('.filter-chip').forEach(chip => {
                    const filterType = chip.getAttribute('data-filter');
                    const filterValue = chip.getAttribute('data-value');
                    
                    // 只保留"全部"选项为选中状态
                    if (filterValue === 'all') {
                        chip.classList.add('active');
                    } else {
                        chip.classList.remove('active');
                    }
                });
                
                // 重置下拉菜单
                document.getElementById('locationFilter').value = 'all';
                document.getElementById('occupationFilter').value = 'all';
                document.getElementById('sortFilter').value = 'recommended';
                
                // 重置滑块
                document.getElementById('distanceRange').value = 50;
                document.getElementById('rangeValue').textContent = '50公里';
                
                // 重置搜索框
                document.querySelector('.form-control[placeholder="输入昵称、兴趣或简介关键词搜索..."]').value = '';
                
                console.log('已重置所有筛选条件');
            });
            
            // 布局切换
            const layoutButtons = document.querySelectorAll('.layout-switcher .btn');
            
            layoutButtons.forEach(button => {
                button.addEventListener('click', function() {
                    layoutButtons.forEach(btn => btn.classList.remove('active'));
                    this.classList.add('active');
                    
                    // 实际应用中这里会切换列表布局
                    if (this.title === '卡片视图') {
                        console.log('切换到卡片视图');
                    } else {
                        console.log('切换到列表视图');
                    }
                });
            });
            
            // 点赞功能
            const likeButtons = document.querySelectorAll('.action-btn:has(.fas.fa-heart)');
            
            likeButtons.forEach(button => {
                button.addEventListener('click', function() {
                    this.classList.toggle('liked');
                    const countElement = this.childNodes[2].textContent.trim();
                    let count = parseInt(countElement);
                    
                    if (this.classList.contains('liked')) {
                        this.childNodes[2].textContent = ` ${count + 1}`;
                    } else {
                        this.childNodes[2].textContent = ` ${count - 1}`;
                    }
                });
            });
            
            // 收藏功能
            const saveButtons = document.querySelectorAll('.action-btn:has(.fas.fa-bookmark)');
            
            saveButtons.forEach(button => {
                button.addEventListener('click', function() {
                    this.classList.toggle('active');
                });
            });
        });
    </script>
</body>
</html>
    
